#include "MovingObject.h"
#include "BaseBehavior.h"
#include "BehaviorManager.h"
#include "AnimationManager.h"
#include "Game.h"


/*virtual*/ void MovingObject::Update(float dt)	 /*override*/
{
	
	m_ptPosition += m_vtVelocity * dt;
	BaseObject::Update(dt);
}


/*virtual*/ void MovingObject::HandleCollision(const IBase* pOther) /*override*/
{

	m_ptPosition -= m_vtVelocity * Game::GetInstance()->DeltaTime();

	m_vtVelocity = { 0, 0 };

}


void MovingObject::SetWayPoint(unsigned int newWayPoint)
{
	if (newWayPoint >= m_vWayPoints.size())
		m_nCurrWaypoint = 0;
	
	else
		m_nCurrWaypoint++;
}

void MovingObject::findFirstPath(int start, int end, vector<unsigned int>& currPath)
{
	navGraph->FindPath(start, end, currPath);

}